<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Twitter Backup</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="tbackup.css" rel="stylesheet" type="text/css">
</head>

<script language="javascript" type="text/javascript">
function submitForm() {
	var _obj = document.getElementById("twitterid");
	
	if (_obj.value.length == 0) {
		alert("Please enter the Twitter ID.");
		_obj.focus();
		return;
	}
	
	_obj = document.getElementById("frompage");
	var _fromPage = parseInt(_obj.value);
	
	if (_fromPage <= 0) {
		alert("From Page must be greater than 0.");
		_obj.focus();
		return;
	}
	
	_obj = document.getElementById("topage");
	if (_obj.value.length > 0) {
		var _toPage = parseInt(_obj.value);
		
		if (_toPage <= 0 || _toPage < _fromPage) {
			alert("To Page must be greater than 0 and must be not less than From Page.");
			_obj.focus();
			return;
		}
	}
	
	_obj = document.getElementById('password');
	if (document.getElementById('username').value.length != 0 && _obj.value.length == 0) {
		alert("Please enter the password.");
		_obj.focus();
		return;
	}
	
	document.getElementById("tbackup").submit();
}
</script>

<body>
<h2>Twitter Backup - Home </h2>
<div style="border-top:2px dashed #cccccc;height: 1px;overflow:hidden;width:550px"></div>
<form action="process.php" method="post" name="tbackup" id="tbackup">
  <table width="550" border="0" cellpadding="2">
    <tr class="row">
      <td width="80">Twitter ID</td>
      <td><span class="row">
        <input name="twitterid" type="text" id="twitterid">
        <span class="red">(*)</span></span></td>
    </tr>
    <tr class="row">
      <td>From Page</td>
      <td><input name="frompage" type="text" id="frompage" value="1">
        <span class="red">(*)</span> to page 
      <input name="topage" type="text" id="topage"> 
      (Empty for last page)</td>
    </tr>
    <tr class="row">
      <td>Username</td>
      <td><input name="username" type="text" id="username"> 
      (Use for protected Twitter ID only)</td>
    </tr>
    <tr class="row">
      <td>Password</td>
      <td><input name="password" type="password" id="password">
      (Use for protected Twitter ID only)</td>
    </tr>
    <tr class="row">
      <td colspan="2" class="red">Note: To avoid the calling rate limit of Twitter API, the page count should not exceed 150 per hour. If you got the error, please try the remaining pages next hour.</td>
    </tr>
    <tr class="row">
      <td>&nbsp;</td>
      <td><input name="Start" type="button" id="Start" value="Start" onClick="submitForm()">
      <input type="reset" name="Reset" value="Reset"></td>
    </tr>
  </table>
</form>
<div style="border-top:2px dashed #cccccc;height: 1px;overflow:hidden;width:550px"></div>
<p>Follow me on Twitter: <a href="http://twitter.com/lordong" target="_blank">@lordong</a></p>
<p>My Blog: <a href="http://www.lordong.net/blog" target="_blank">LorDong's Blog</a></p>
<p>Source Code: <a href="http://code.google.com/p/tbackup" target="_blank">http://code.google.com/p/tbackup</a></p>
<a href='download.php'>Download</a>
</body>
</html>
